package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;
import java.util.Set;

/**
 * 用户实体类
 */
@TableName("t_user")
public class UserBean {
    //用户id
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;
    //用户账户
    @TableField("u_userName")
    private String userName;
    //用户真实姓名
    @TableField("u_name")
    private String name;
    //用户密码
    @TableField("u_pwd")
    private String pwd = "123";
    //角色集合
    @TableField(exist = false)
    private Set<RoleBean> roleList;
    //权限集合
    @TableField(exist = false)
    private Set<PowerBean> powerList;

    public UserBean() {
    }

    public UserBean(String userName, String name) {
        this.userName = userName;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public Set<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(Set<RoleBean> roleList) {
        this.roleList = roleList;
    }

    public Set<PowerBean> getPowerList() {
        return powerList;
    }

    public void setPowerList(Set<PowerBean> powerList) {
        this.powerList = powerList;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", roleList=" + roleList +
                ", powerList=" + powerList +
                "}\n";
    }
}
